<template>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%">
      <span>是否确认删除该条数据项？</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="clickComfirm">确 定</el-button>
      </span>
    </el-dialog>

</template>

<script>
    import { deleteAboutUsBanner } from '@/api/system/about_us_banner';
    export default{
        props:{
            // 父组件给子组件传递数据   属性property
            formId:Number
        },
         data(){
           return{
              dialogVisible:false,
              data:{
                  id:-1
              }
           }
         },
        methods: {
          showDialog(){
            this.dialogVisible=true;
          },
          hideDialog(){
            this.dialogVisible=false;
          },
          clickComfirm() {
              this.data.id=this.formId;
              console.log("id=",this.data.id);
              this.$emit('delete-event',this.data);

              // deleteAboutUsBanner(this.data).then(response => {
              //     console.log(response);
              //     this.dialogVisible=false;
              //     // this.$emit('custom-event', data); // 触发自定义事件，并传递数据给父组件
              //     this.$emit('custom-event');

              // });

           }

        }
    }
</script>

<style>
</style>
